import request from '@/utils/request'
// 根据售货机获取运营人员列表
export const vendingMachine = (innerCode) => {
  return request({
    url: `/api/user-service/user/operatorList/${innerCode}`
  })
}
// 获取售货机货道详情(添加工单里需要)
export const addVending = (innerCode) => {
  return request({
    url: `/api/vm-service/channel/channelList/${innerCode}`
  })
}
// 补货详情
export const replenishmentDetails = (taskId) => {
  return request({
    url: `/api/task-service/taskDetails/${taskId}`
  })
}
// 获取补货预警值
export const alertValueFn = (alertValue) => {
  return request({
    url: `/api/task-service/task/supplyAlertValue`,
    alertValue
  })
}
// 设置自动补货工单阈值
export const thresholdValue = (data) => {
  return request({
    url: `/api/task-service/task/autoSupplyConfig`,
    method: 'POST',
    data

  })
}
// pageIndex	否		页码
// pageSize	否		每页数量
// status	否		售货机状态(0:未投放;1-运营;3-撤机)
// innerCode	否		售货机编号
// 搜索售货机(售货机列表)status售货机状态(0:未投放;1-运营;3-撤机)
export const searchMachine = ({ pageIndex, pageSize, status, innerCode }) => {
  return request({
    url: `/api/vm-service/vm/search`,
    params: {
      pageIndex, pageSize, status, innerCode
    }
  })
}
